<?php 
include('inc/config.php');
?>
<style type="text/css">
a.thumbnail {
    color: #000000;
    display: block;
    text-decoration: none;
}
a.thumbnail:hover {
    color: #0096FF;
}
a.thumbnail img {
    opacity: 0.8;
}
a.thumbnail:hover img {
    border: 1px solid #0096FF;
    opacity: 1;
}
</style>
<div style="top:15px;;position:relative;background-image:url(img/top_menu2.png);width:640px;height:45px;">
    <div style="width:400px;position:relative;top:6px;left:20px;">
    <font style="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif;font-size:20px;color:white;" >Galeria de V&iacute;deos</font>
    </div>
</div>
<div style="height:10px;"></div>
<?php include 'internas/redesocial.php'; ?>
<div class="vid2">
    <div class="clearfix thumbnails yoxview">
        <?php
        $sql_video = mysql_query("SELECT url,id,legenda FROM video ORDER BY id  ");
        $total = mysql_num_rows($sql_video);
            while (list($url,$id,$legenda)=mysql_fetch_array($sql_video)){
                    $youtubeVideo1 = $url;
                    $url2 = explode('=',$url);
                    ?>
                    <div id="video2">
                    <a class="thumbnail clearfix" style="text-decoration:none;" href="<?php echo $url; ?>" >
                        <img id="vimg" src="http://i.ytimg.com/vi/<?php echo $url2[1]; ?>/default.jpg" />
                        <center>
                            <span>
                                <font style="font-family:Arial, Helvetica, sans-serif;font-size:12px;">
                                <?php 
                                if (strlen($legenda) > 45){ 
                                echo substr($legenda,0,45)." .....";
                                }else{
                                echo $legenda; 
                                } ?>
                                </font>
                            </span>
                        </center>
                    </a>
                    </div>
        <?php
                }
        ?>
    </div>
</div>